<?php

namespace App\Observers;

use App\Models\ExChanging;
use Illuminate\Support\Facades\Log;

class ExChangeObserver
{
    /**
     * Handle the ExChanging "created" event.
     *
     * @param  \App\Models\ExChanging  $exChanging
     * @return void
     */
    public function created(ExChanging $exChanging)
    {
        //
        Log::info('成功添加了一件商品' . $exChanging['name']);
    }

    /**
     * Handle the ExChanging "updated" event.
     *
     * @param  \App\Models\ExChanging  $exChanging
     * @return void
     */
    public function updated(ExChanging $exChanging)
    {
        Log::info('又添加了一件商品' . $exChanging->goods_name . '+1');
    }

    /**
     * Handle the ExChanging "updating" event.
     *
     * @param  \App\Models\ExChanging  $exChanging
     * @return void
     */
    public function updating(ExChanging $exChanging)
    {
        Log::info('又添加了一件商品' . $exChanging);
    }


    /**
     * Handle the ExChanging "deleted" event.
     *
     * @param  \App\Models\ExChanging  $exChanging
     * @return void
     */
    public function deleted(ExChanging $exChanging)
    {
        //
    }

    /**
     * Handle the ExChanging "restored" event.
     *
     * @param  \App\Models\ExChanging  $exChanging
     * @return void
     */
    public function restored(ExChanging $exChanging)
    {
        //
    }

    /**
     * Handle the ExChanging "force deleted" event.
     *
     * @param  \App\Models\ExChanging  $exChanging
     * @return void
     */
    public function forceDeleted(ExChanging $exChanging)
    {
        //
    }
}
